﻿<UserControl x:Class="Views.ViewSelectionMedicale"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Theme="clr-namespace:OMANE.Common.UI.Theme;assembly=OMANE.Common.UI.Theme"
             mc:Ignorable="d"
             Style="{StaticResource controlOMANE}"
             Width="400"
             Height="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1.5*"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="60"></RowDefinition>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="45"></RowDefinition>
        </Grid.RowDefinitions>
        <TextBlock FontWeight="Normal"
                   TextWrapping="Wrap"
                   VerticalAlignment="Center"
                   Grid.Column="0" 
                   Grid.Row="0">Nombre d'années après la souscription impactées par la sélection médicale</TextBlock>
        <Theme:NumericEditor FontWeight="Normal"
                             Value="{Binding MaxDeroulement}"
                             Width="Auto"
                             Margin="20,0,0,0" 
                             Grid.Column="1" 
                             Grid.Row="0" 
                             VerticalAlignment="Center" 
                             Style="{StaticResource NumberEditor}" ></Theme:NumericEditor>
        <DataGrid FontWeight="Normal"
                  AutoGenerateColumns="False"
                  ItemsSource="{Binding Valeurs}"
                  ColumnWidth="*"
                  CanUserAddRows="False"
                  CanUserDeleteRows="False"
                  Grid.Row="1" 
                  Grid.Column="0" 
                  Grid.ColumnSpan="2">
            
            <DataGrid.Columns>
                <!-- Nombre d'années de déroulement -->
                <DataGridTextColumn IsReadOnly="True">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Année de déroulement depuis la souscription" 
                                       TextWrapping="Wrap" 
                                       HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="nbAnneesDerlt" StringFormat="N0" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>
                <!-- Abattement dû à la sélection médicale -->
                <DataGridTextColumn IsReadOnly="False">
                    <DataGridTextColumn.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Abattement dû à la sélection médicale" 
                                       TextWrapping="Wrap" 
                                       HorizontalAlignment="Center" />
                        </DataTemplate>
                    </DataGridTextColumn.HeaderTemplate>
                    <DataGridTextColumn.Binding>
                        <Binding Path="abatSelMedic" StringFormat="0.0%" />
                    </DataGridTextColumn.Binding>
                </DataGridTextColumn>
            </DataGrid.Columns>
        </DataGrid>
        
        <StackPanel Grid.Column="1" Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Name="Btn_Valider" FontWeight="Normal" Width="55" Margin="0,20,5,0">Valider</Button>
            <Button Name="Btn_Annuler" FontWeight="Normal" Width="55" Margin="0,20,0,0">Annuler</Button>
        </StackPanel>
    </Grid>
</UserControl>
